home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Business Shareware
/
Business Shareware.iso
/
start
/
edu
/
romancvt
/
roman.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-14
|
687b
|
42 lines
/* roman.c
Converts an Arabic number to its Roman equivalent
David S McMeans Not copyrighted April 1993
mcmeans@dtedi.hq.aflc.af.mil
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main( argc, argv )
int argc;
char **argv;
{
char buf[80];
unsigned long int i,j;
extern char *Roman_1000;
Roman_1000 = "G";
if (argc < 2)
{
printf("Usage: %s <arabic number>\n", argv[0] );
exit( 1 );
}
i = (unsigned long int )atol( argv[1] );
printf( " Arabic %lu Roman: %s\n", i, Arabic2Roman( i, buf ));
#if 0
for (j=1; j <= i; j++)
printf("%d %s\n", j, Arabic2Roman( j, buf ));
#endif
}